<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>游戏大厅</title>
  <style>
    /* 整体页面布局 */
    body {
      font-family: Arial, sans-serif;
      margin: 0;
      padding: 0;
      background-color: #333;
      color: white;
    }

   .container {
      max-width: 800px;
      margin: 0 auto;
      padding: 20px;
    }

    /* 导航栏样式 */
    nav {
      background-color: #555;
      padding: 10px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    nav ul {
      list-style-type: none;
      margin: 0;
      padding: 0;
      display: flex;
    }

    nav ul li {
      margin-right: 15px;
    }

    nav ul li a {
      color: white;
      text-decoration: none;
    }

    nav ul li a:hover {
      text-decoration: underline;
    }

    /* 游戏列表样式 */
   .game-list {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-around;
    }

   .game-item {
      background-color: #444;
      width: 200px;
      height: 250px;
      margin: 10px;
      padding: 10px;
      border-radius: 5px;
      text-align: center;
      box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
      cursor: pointer;
    }

   .game-item img {
      max-width: 100%;
      max-height: 150px;
    }

   .game-item h3 {
      margin-top: 10px;
    }

   .game-item p {
      margin-top: 5px;
      font-size: 14px;
    }

    /* 用户信息样式 */
   .user-info {
      text-align: right;
    }

   .user-info p {
      margin: 0;
    }
  </style>
</head>

<body>
  <div class="container">
    <!-- 导航栏 -->
    <nav>
      <div>
        <h1>游戏大厅</h1>
      </div>
      <div class="user-info">
        <p>欢迎，[用户名]</p>
        <a href="#">退出登录</a>
      </div>
    </nav>

    <!-- 游戏列表 -->
    <div class="game-list">
      <div class="game-item" data-path="game1.html">
        <img src="game1.jpg" alt="游戏1">
        <h3>游戏1名称</h3>
        <p>这是一款有趣的游戏1描述。</p>
		<button class="start-game">开始游戏</button>
      </div>
      <div class="game-item" data-path="game2.html">
        <img src="game2.jpg" alt="游戏2">
        <h3>游戏2名称</h3>
        <p>这是一款有趣的游戏2描述。</p>
		<button class="start-game">开始游戏</button>
      </div>
      <div class="game-item" data-path="game3.html">
        <img src="game3.jpg" alt="游戏3">
        <h3>游戏3名称</h3>
        <p>这是一款有趣的游戏3描述。</p>
		<button class="start-game">开始游戏</button>
      </div>
    </div>
  </div>
  
  <!-- <div class="game-item" data-path="game1.html">Game 1</div> -->
  <!-- <div class="game-item" data-path="game2.html">Game 2</div> -->
  <!-- <div class="game-item" data-path="game3.html">Game 3</div> -->
  
  <script>
	const gameItems = document.querySelectorAll('.game-item');
		gameItems.forEach(item => {
			item.addEventListener('click', function () {
				 const path = item.getAttribute('data-path');
				// 根据游戏项目的不同，设置不同的跳转链接
				window.location.href = path; 
			});
		});
  </script>
</body>

</html>